@extends('home.layouts')
@section('content')

    <div class="pet_article_dowload_content pet_dowload_more_top_bg">
        <div class="pet_article_dowload_triangle pet_dowload_more_top_san"></div>

        @foreach($attentions as $k=>$c1)
            <div data-tab-panel-0 class="am-tab-panel">
                <div class="pet_comment_list_block">
                    <div class="pet_comment_list_block_l">
                        <a style="color: black" href="{{url('authorarticle/'.$c1['id'].'/1')}}"><img src="{{$c1['avatar']}}-40X40" alt=""></a></div>
                    <div class="pet_comment_list_block_r">
                        <div class="pet_comment_list_block_r_info"><a style="color: black" href="{{url('authorarticle/'.$c1['id'].'/1')}}">{{$c1['username']}}</a>
                            <span style="float: right;font-size: 11px;font-weight: bold;color: red" onclick="unstar({{$c1['id']}},3)">取消关注</span></div>
                        <div class="pet_comment_list_block_r_text"> <a style="color: black" href="{{url('authorarticle/'.$c1['id'].'/1')}}">{{$c1['describe']}}</a></div>
                        <div class="pet_comment_list_block_r_bottom">
                            <div class="pet_comment_list_bottom_info_l">{{date('Y-m-d H:i:s',$c1['created_at'])}}关注</div>
                            <div class="pet_comment_list_bottom_info_r">
                            <span>{{$fansnum[$k]}} 粉丝</span></div>
                        </div>
                    </div>
                </div>
            </div>
        @endforeach
    </div>
    @endsection

@section('javascript')
    <script>
        function unstar(id,type){
            layer.confirm('你确定要取消关注吗？',{
                btn:['确定','取消']
            },function(i){
                layer.close(i);
                layer.load(1);
                $.post('{{url('unstar')}}',{'_token':'{{csrf_token()}}','id':id,'type':type},function(res){
                    if(res.status){
                        location.reload();
                    }else{
                        layer.msg(res.msg);
                    }
                })
            },function(){

            });
        }
    </script>
    @endsection